package com.merlin.demo.log;

import org.springframework.stereotype.Component;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Component
@Aspect
public class LogAspect {

	@Pointcut("@annotation(com.merlin.demo.log.Log)")
	private void cut(){
		
	}
	
	
	@Around("cut()")
	public void advice(ProceedingJoinPoint joinPoint){
		System.out.println("环绕通知开始....");
		try {
			joinPoint.proceed();
		} catch (Throwable e) {
			e.printStackTrace();
		}
		System.out.println("环绕通知结束....");
	}
}
